//
//  ViewController.m
//  ColorSel
//
//  Created by 李江湖 on 2018/1/19.
//  Copyright © 2018年 李江湖. All rights reserved.
//

#import "ViewController.h"
#import "JH_ColorSelView.h"
#import "JH_RGB_View.h"
@interface ViewController ()<JH_ColorSelDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    JH_ColorSelView *colorview = [[NSBundle mainBundle] loadNibNamed:@"JH_ColorSelView" owner:self options:nil][0];
    colorview.frame = CGRectMake(0, 64,K_W, 80);
    colorview.colordelegate = self;
    [self.view addSubview:colorview];
    colorview.size = CGSizeMake(200, 80);
    
    JH_RGB_View *rgbview = [[JH_RGB_View alloc]initWithFrame:CGRectMake(0, 0, 200, 200)];
    [self.view addSubview:rgbview];
    rgbview.center = self.view.center;
    [rgbview setPickerStyle:JHColorPickerStyleRing andBlock:^(UIColor *color) {
        self.view.backgroundColor = color;
    }];
    [rgbview setPickerInnerRadius:80];
    
}
-(void)setingColorindex:(NSInteger)index andTitle:(NSString *)title color:(UIColor *)color
{
    NSLog(@"%ld:%@",index,title);
    self.view.backgroundColor = color;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
